﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="TableAdd.aspx.cs" Inherits="CodeAuto.Pages.TableAdd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style="min-height: 600px;">
        <%
            if (IsLogin)
            {
        %>
        <h2>
            添加数据表
        </h2>
        <p>
            请输入表信息。
            <asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="false">返回</asp:HyperLink>
        </p>
        <span class="failureNotification">
            <asp:Literal ID="FailureText" runat="server"></asp:Literal>
        </span>
        <div class="accountInfo">
            <fieldset class="login">
                <legend>数据表信息</legend>
                <p>
                    <asp:Label ID="TableNameLabel" runat="server">数据表名称:</asp:Label>
                    <asp:TextBox ID="TableName" runat="server" CssClass="textEntry"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="Label1" runat="server">备 注 名 称:</asp:Label>
                    <asp:TextBox ID="TextBox1" runat="server" CssClass="textEntry"></asp:TextBox>
                </p>
            </fieldset>
            <fieldset class="login">
                <legend>字段信息</legend>
                <div id="fields">
                </div>
     <%--           <input type="button" value="增加字段" style="width: 80px;" onclick="addfield()" />--%>
            </fieldset>
            <p class="submitButton">
                <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="确定" OnClick="LoginButton_Click"
                    ValidationGroup="LoginUserValidationGroup" />
            </p>
        </div>
        <%
            }
        %>
    </div>
    <script type="text/javascript">
        var allcount = 0;
        function addfield() {
            var html = $("#fields").html();
            html += "<p>字段：<input type=\"text\" id=\"f" + allcount + "\" name=\"f" + allcount + "\" /> 备注：<input type=\"text\" id=\"n" + allcount + "\" name=\"n" + allcount + "\" /> <input type=\"radio\" name=\"add" + allcount + "\" value=\"string\" />String&nbsp;<input type=\"radio\" name=\"add" + allcount + "\" value=\"DateTime\" />DateTime&nbsp;<input type=\"radio\" name=\"add" + allcount + "\" value=\"int\" />Int<input type=\"radio\" name=\"add" + allcount + "\" value=\"double\" />Double</p>";
            html += "字段赋值控件：<input type=\"radio\" name=\"InputType" + allcount + "\" value=\"textbox\" />Textbox&nbsp;<input type=\"radio\" name=\"InputType" + allcount + "\" value=\"radio\" />Radio&nbsp;<input type=\"radio\" name=\"InputType" + allcount + "\" value=\"checkbox\" />CheckBox<input type=\"radio\" name=\"InputType" + allcount + "\" value=\"select\" />Select<input type=\"radio\" name=\"InputType" + allcount + "\" value=\"timebox\" />TimeBox<input type=\"radio\" name=\"InputType" + allcount + "\" value=\"kindeditor\" />KindEditor</p>";
            $("#fields").html(html);
            allcount++;
        }
        for (var i = 0; i < 50; i++) {
            addfield();
        }
        $("#f0").val("Id");
        $("#n0").val("编号");
        $("input:eq(8)").attr("checked", "checked");
    </script>
</asp:Content>
